<?php


namespace api\controller;


use common\controller\VerifyController;
use common\service\CustomerService;
use think\Request;

class CustomerController extends VerifyController
{
    /**
     * @var CustomerService
     */
    private $customerService;

    public function __construct()
    {
        parent::__construct();
        $this->customerService = new CustomerService();
    }

    /**
     * 获取客户列表
     * @param Request $request
     * @return \think\Response
     * @throws \Exception
     */
    public function select(Request $request)
    {
        $resData = $this->customerService->getCustomerList($request->param(), $request->tenantId);
        return json(success_response('', $resData));
    }

    /**
     * 查询客户详情
     * @param Request $request
     * @return \think\Response
     * @throws \Exception
     */
    public function find(Request $request)
    {
        $resData = $this->customerService->getCustomer($request->param());
        return json(success_response('', $resData));
    }

}